package com.foruo.sc.upload.file.server.dao;

import com.foruo.sc.upload.file.server.entity.FileEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

/**
 * dao层接口
 * @author GaoYuan
 * @date 2018/4/9 下午4:06
 */
public interface UploadFileDao extends JpaRepository<FileEntity, Long> {

    @Transactional
    @Modifying
    @Query(value = "update sc_file a set a.status = :status  where a.url = :url", nativeQuery = true)
    void updateStatus(@Param(value = "url") String url,@Param(value = "status") String status);
}
